package tsli.acm.ctrl;

import java.text.DecimalFormat;

import tsli.acm.dao.*;
import tsli.acm.database.Database;

public class MMComponentAPIMethod {
//	String vaPeNoBm = "121400006";
//	String vaClosYm = "201411";
//	
//	public void calculateMMIncentive(){
//		Database db = new Database();
//		SFCCommissionPositiveDAO voSFCCommissionPositiveDAO = new SFCCommissionPositiveDAO(db);
//		PersistencyDAO voPersistencyDAO = new PersistencyDAO(db);
//		RententionDAO voRententionDAO = new RententionDAO(db);
//		String vaDataQuery = voSFCCommissionPositiveDAO.findPaymentRateAndPC( vaPeNoBm,vaClosYm);	
//		// PC and PaymentRate values
//		double vnPc = 0.0 , vnPaymentRate = 0.0 , vnPersistencyModify = 0.0 , vnRetentionRatio = 0.0;
//		try {
//			String[] voDataSplit = vaDataQuery.split("/");
//			vnPc = Double.parseDouble( voDataSplit[0]);
//			vnPaymentRate = Double.parseDouble( voDataSplit[1]);
//			vnPersistencyModify = Double.parseDouble(voPersistencyDAO.getPersistencyModifyFOrMM(vaPeNoBm,vaClosYm));
//			vnRetentionRatio = Double.parseDouble(voRententionDAO.getRetentionRatioByForMM(vaPeNoBm,vaClosYm));
//			
//			double total = vnPc * vnPaymentRate * vnPersistencyModify * vnRetentionRatio;
//			
//			DecimalFormat voDecimalFormat = new DecimalFormat("#.##");
//			
//			System.out.println("PC : "+vnPc);
//			System.out.println("Payment Rate : "+vnPaymentRate);
//			System.out.println("Persistency Modify : "+vnPersistencyModify);
//			System.out.println("Retention Ratio : "+vnRetentionRatio);
//			System.out.println("Total : "+voDecimalFormat.format(total));
//		} catch (Exception e) {
//			e.printStackTrace();
//		}
//		db.close();	
//	}
}
